public class ThreadDemo9 {

    public static void main(String[] args) {
        boolean isQuit = false;
        Thread t = new Thread(() -> {
           while (!isQuit) {
               System.out.println("hello t");
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException e) {
                   e.printStackTrace();
               }
           }

            System.out.println("t 终止了");
        });
        t.start();
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
